home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual Foxpro 6.0 (Ent. Edition) / Vf6ent Extractor.EXE / TOOLS / XSOURCE / XSOURCE.ZIP / vfpsource / wizards / automate / NOTES.TXT < prev    next >
Encoding:
Text File  |  1998-05-01  |  3.5 KB  |  110 lines

  1. *----------------------------------------------------------
  2. MailMerge class notes
  3.  
  4. To use:
  5.  
  6. *- open table or view first, and prepare array of field names
  7.  
  8. oMM = CREATE("MailMerge")            && create object
  9.  
  10. *- set values
  11. oMM.cAppTitle = "My Application"    && application name, used in Alerts    
  12. oMM.nWordProc = nWordProc            && word processor (1 = Word 6+; 2 = CommaDelim; or user-defined (see below); default = 1)
  13. oMM.nNewDoc = nNewDoc                && is it a new doc (1 = new, 2 = existing; default = 1)
  14. oMM.nTemplate = nTemplate            && type of main document (Word only, 1 = form letter; 2 = label; 3 = envelope; 4 = catalog; default = 1)
  15. oMM.cDocName = cDocName                && doc file if not new
  16. oMM.cAlias = cTableAlias            && alias of source table or view
  17. oMM.cDBCTable = cTableName            && table name if table is part of a DBC
  18. oMM.cDBCName = cDatabaseName        && DBC name if source table is part of a DBC
  19. ACOPY(aMyFields, oMM.aAutoFields)    && fill in array of field names to be used
  20.  
  21. oMM.Merge                            && do the merge
  22.  
  23.  
  24. In the following example, the sample data table customer is used to create a new mailmerge form letter document in MS-Word (the defaults), using the customer.company and customer.city fields:
  25.  
  26. ox = newobject("mailmerge",HOME()+"FFC\mailmrge.vcx")
  27. use c:\vfp\samples\data\customer
  28. set database to testdata
  29. ox.cAlias = "customer"
  30. ox.cdbctable = "customer"
  31. ox.cdbcname = DBC()
  32. DIMENSION ox.aAutoFields[2]
  33. ox.aAutoFields[1] = "company"
  34. ox.aAutoFields[2] = "city"
  35. ox.makeoutput
  36.  
  37.  
  38.  
  39. To add a custom mailmerge function:
  40.  
  41. oMM = CREATE("MailMerge")
  42. DIMENSION oMM.aWPMrg[ALEN(oMM.aWPMrg,1) + 1]
  43. oMM.aWPMrg[ALEN(oMM.aWPMrg,1)] = "MyMailMergeFunction"
  44. oMM.nWordProc = ALEN(oMM.aWPMrg,1)
  45.  
  46. or just replace an existing one:
  47.  
  48. oMM.aWPMrg[2] = "MyMailMergeFunction"
  49. oMM.nWordProc = 2
  50.  
  51.  
  52. *----------------------------------------------------------
  53. PivotTable class notes
  54.  
  55. To use:
  56.  
  57. USE (HOME() + "samples\data\orders")
  58. SET DATABASE TO testdata
  59. DIMENSION aflds[4,1]
  60. aflds[1,1] = "to_country"
  61. aflds[2,1] = "ship_via"
  62. aflds[3,1] = "order_amt"
  63. aflds[4,1] = "emp_id"
  64. DIMENSION aFList[1,1]
  65. =AFIELDS(aFList)
  66.  
  67. ox = NewObject("pivottable",HOME()+"FFC\pivtable.vcx")
  68. oPiv.cAlias = ALIAS()
  69. oPiv.cDBCTable = DBF()
  70. oPiv.cDBCName = DBC()
  71. oPiv.cPivFldRow = "to_country"
  72. oPiv.cPivFldCol = "ship_via"
  73. oPiv.cPivFldData = "order_amt"
  74. oPiv.cPivFldPage = "emp_id"
  75. oPiv.lHasColumnTotals = .T.
  76. oPiv.lHasRowTotals = .T.
  77. =ACOPY(aflds, oPiv.aAutoFields)
  78. =ACOPY(aFList, oPiv.aFldList)
  79.  
  80. oPiv.MakeOutput
  81.  
  82. *----------------------------------------------------------
  83. Graph automation class notes
  84.  
  85. To use:
  86.  
  87. CLOSE DATA ALL
  88. USE D:\TEMP2\OFFICES.DBF        && a Fox 2.6 sample table
  89.  
  90. SET PATH TO "d:\wiz55work\wzcommon"        && needs to find registry.prg
  91. SET CLASS TO d:\wiz55work\automate\autgraph.vcx
  92.  
  93. oG = CREATEOBJECT("AutoGraph")
  94. DIMENSION oG.aDataFields[1]
  95. oG.aDataFields[1] = "ytdsales"
  96. oG.cCategoryField = "ono"
  97. oG.nChartType = 5                    && Chart Type
  98. oG.nChartSubType = 1                && Chart SubType
  99. oG.nAction = 1
  100. oG.lSeriesByRow = .F.                && Series by Row (.T.), by Column (.F.)
  101. oG.cGraphDBF = "d:\wiz55work\wzgraph\wizgraph.dbf"        && DBF containing cGraphField
  102. oG.cGraphFldRow = "graph_row"        && General field containing setup Graph (series by row)
  103. oG.cGraphFldCol = "graph_col"        && General field containing setup Graph (series by col)
  104. oG.cGraphPrevClass = "graphpreview"    && Class containing preview form
  105. oG.cDefNewField = "olegraph"        &&default field name in new table
  106. oG.MakeOutput
  107.  
  108. USE D:\TEMP2\VFPGRAPH.DBF
  109. GO BOTTOM
  110. MODIFY GENERAL vfpgraph.olegraph NOWAIT